package testebancodedados;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.UIManager;

public class main {

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) { }
        
        JFrame principal = new JFrame();
        
        ClienteCRUDForm formCliente = new ClienteCRUDForm();
        FilmeCRUDForm formFilme = new FilmeCRUDForm();
        LocacaoForm formLocacao = new LocacaoForm();
        JTabbedPane panel = new JTabbedPane();
        JTabbedPane panel2 = new JTabbedPane();
        panel.addTab("Locação", formLocacao.novoForm());
        panel.addTab("Cadastro Cliente", formCliente.novoForm());
        panel.addTab("Cadastro Filme", formFilme.novoForm());
        principal.add(panel);
        
        principal.addWindowListener(new main.CloseListener());
        principal.setTitle("LocaFacil - Gerenciamento de Locações");
        principal.setSize(400, 300);
        principal.setVisible(true);
    }
    
    public static class CloseListener extends WindowAdapter {
        
        @Override
        public void windowClosing(WindowEvent e) {
            e.getWindow().setVisible(false);
            System.exit(0);
        }
    }
}